// import axios from 'axios';
import axios from '../../libs/api.request'
import apiPreTool from './apiPreTool'

export default {
    getCustomViewApi(formId) {
        return axios.request({
            url   : apiPreTool.getApiUrl('/forms/' + formId + '/view'),
            method: 'get',
        });
        // return axios.get('/api/admin/v1/forms/' + formId + '/view');
    },
    setCustomViewApi({formId, list}) {
        return axios.request({
            url   : apiPreTool.getApiUrl('/forms/' + formId + '/view'),
            method: 'put',
            data  : {list: list}
        });
        // return axios.put('/api/admin/v1/forms/' + formId + '/view', {list: list});
    },
    resizeCustomViewApi({id, width}) {
        return axios.request({
            url   : apiPreTool.getApiUrl('/forms/view/' + id + '/resize'),
            method: 'put',
            data  : {width: width}
        });
        // return axios.put('/api/admin/v1/forms/view/' + id + '/resize', {width: width})
    }
}
